<template>
  <div id="app">

    <el-container>
      <el-header  class="main-header" style="height:70px;">
        <nav class="navbar navbar-static-top">
          <!-- Logo -->
          <a href="#" class="logo" style="text-align:center">
            <span class="logo-lg"><img src="../assets/logo.png"></span>
          </a>
          <div class="right-menu">
            <span class="help"><i class="fa fa-exclamation-circle" aria-hidden="true"></i>帮助</span>
            <el-dropdown class="avatar-container right-menu-item" trigger="click">
              <div class="avatar-wrapper">
                <img src="../assets/user2-160x160.jpg" class="user-avatar">
                Jay.Liu
              </div>
              <el-dropdown-menu slot="dropdown">
                <el-dropdown-item divided>
                  <span style="display:block;">修改密码</span>
                </el-dropdown-item>
                <el-dropdown-item divided>
                  <span style="display:block;">退出</span>
                </el-dropdown-item>
              </el-dropdown-menu>
            </el-dropdown>
          </div>
        </nav>
      </el-header>
      <el-container>
        <el-aside width="200px">
          <el-menu>
            <el-submenu v-for="menu in menuList" :index="menu.path">
              <template slot="title">
                <i class="fa" :class="menu.icon"></i>
                {{menu.title.split(' ')[0]}}
              </template>
              <template v-for="child in menu.children">
                <el-menu-item :index="child.path">
                  <router-link target="right"
                               :to="`/index/${menu.title.split(' ')[1]}/${child.linkUrl}`">
                    {{child.title}}
                  </router-link>
                  <!--                  <router-link target="right"
                                                :to="`/member/document`">
                                      {{child.title}}
                                    </router-link>-->
                </el-menu-item>
              </template>
            </el-submenu>
          </el-menu>
        </el-aside>
        <el-container>
          <router-view></router-view>
        </el-container>
        <!--        <el-container>
                  <iframe name="right" class="el-main" src="ordersetting.html" width="100%" height="580px" frameborder="0"></iframe>
                </el-container>-->
      </el-container>
    </el-container>
  </div>
</template>

<script>
import Appointment from "@/pages/Appointment";
import ExaminationUploaded from "@/pages/ExaminationUploaded";
import HealthAssessment from "@/pages/HealthAssessment";
import Member from "@/pages/Member";
import MemberAnalysis from "@/pages/MemberAnalysis";
import MemberDocument from "@/pages/MemberDocument";
import StatisticalAnalysis from "@/pages/StatisticalAnalysis";
import WorkBench from "@/pages/WorkBench";


export default {
  name: 'Index',
  components:{
    Appointment,
    ExaminationUploaded,
    HealthAssessment,
    Member,
    MemberDocument,
    MemberAnalysis,
    StatisticalAnalysis,
    WorkBench
  },
  data(){
    return {
      menuList:[
        {
          "path": "1",
          "title": "工作台 bench",
          "icon":"fa-dashboard",
          "children": []
        },
        {
          "path": "2",
          "title": "会员管理 member",
          "icon":"fa-user-md",
          "children": [
            {
              "path": "/2-1",
              "title": "会员档案",
              "linkUrl":"document",
              "children":[]
            },
            {
              "path": "/2-2",
              "title": "体检上传",
              "linkUrl": "examination_uploaded",
              "children":[]
            },
            {
              "path": "/2-3",
              "title": "会员统计",
              "linkUrl":"member_analysis",
              "children":[]
            },
          ]
        },
        {
          "path": "3",
          "title": "预约管理 appointment",
          "icon":"fa-tty",
          "children": [
            {
              "path": "/3-1",
              "title": "预约列表",
              "linkUrl":"appointment_list",
              "children":[]
            },
            {
              "path": "/3-2",
              "title": "预约设置",
              "linkUrl":"appointment_setup",
              "children":[]
            },
            {
              "path": "/3-3",
              "title": "套餐管理",
              "linkUrl":"package_management",
              "children":[]
            },
            {
              "path": "/3-4",
              "title": "检查组管理",
              "linkUrl":"group_management",
              "children":[]
            },
            {
              "path": "/3-5",
              "title": "检查项管理",
              "linkUrl":"project_management",
              "children":[]
            },
          ]
        },
        {
          "path": "4",
          "title": "健康评估 health",
          "icon":"fa-stethoscope",
          "children":[
            {
              "path": "/4-1",
              "title": "中医体质辨识",
              "linkUrl":"chinese_medicine",
              "children":[]
            },
          ]
        },
        {
          "path": "5",     //菜单项所对应的路由路径
          "title": "统计分析 analysis",     //菜单项名称
          "icon":"fa-heartbeat",
          "children":[//是否有子菜单，若没有，则为[]
            {
              "path": "/5-1",
              "title": "工作量统计",
              "linkUrl":"workload",
              "children":[]
            },
            {
              "path": "/5-2",
              "title": "套餐统计",
              "linkUrl": "setmeal",
              "children":[]
            },
            {
              "path":"/5-3",
              "title":"运营数据统计",
              "linkUrl":"business",
              "children":[]
            }
          ]
        }
      ]
    }
  },
}
</script>

<style scoped>

</style>